]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
magnifier: Fix cursor offset
authorАндрей Гриценко <andrej.gricenko@gmail.com>
Mon, 29 May 2023 14:42:13 +0000 (17:42 +0300)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 7 Jun 2023 20:52:27 +0000 (22:52 +0200)
Commit c449058d447c2588d changed the pointer clone to use a single
actor. However that broke applying the hotspot translation to the
position, so the magnified cursor is now displayed with a shift.

Undo the change to restore the old behavior.

This reverts commit c449058d447c2588de81df2e2bd7a1ae98c4060f.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2780>

js/ui/magnifier.js

index f4012dedfc134867202c0ed68fb4f4f5272551f0..bd6904758dfa3dcfef70a468d7f1a992782b1b2e 100644 (file)
@@ -103,12 +103,15 @@ var Magnifier = class Magnifier extends Signals.EventEmitter {
         this._mouseSprite = new Clutter.Actor({ request_mode: Clutter.RequestMode.CONTENT_SIZE });
         this._mouseSprite.content = new MouseSpriteContent();
 
+        this._cursorRoot = new Clutter.Actor();
+        this._cursorRoot.add_actor(this._mouseSprite);
+
         // Create the first ZoomRegion and initialize it according to the
         // magnification settings.
 
         [this.xMouse, this.yMouse] = global.get_pointer();
 
-        let aZoomRegion = new ZoomRegion(this, this._mouseSprite);
+        let aZoomRegion = new ZoomRegion(this, this._cursorRoot);
         this._zoomRegions.push(aZoomRegion);
         this._settingsInit(aZoomRegion);
         aZoomRegion.scrollContentsTo(this.xMouse, this.yMouse);
@@ -283,7 +286,7 @@ var Magnifier = class Magnifier extends Signals.EventEmitter {
      * @returns {ZoomRegion} the newly created ZoomRegion.
      */
     createZoomRegion(xMagFactor, yMagFactor, roi, viewPort) {
-        let zoomRegion = new ZoomRegion(this, this._mouseSprite);
+        let zoomRegion = new ZoomRegion(this, this._cursorRoot);
         zoomRegion.setViewPort(viewPort);
 
         // We ignore the redundant width/height on the ROI